﻿using System;
using HigLabo.Net.Extensions;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public class UserMention : ResponseObject
    {
        /// <summary>
        /// 
        /// </summary>
        public Int64 ID { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String IDString { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Indices Indices { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String Name { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public String ScreenName { set; get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public UserMention(String jsonText)
        {
            this.SetProperty(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public override void SetProperty(string jsonText)
        {
            var d = this.SetData(jsonText);

            this.ID = d.ToInt64("id") ?? 0;
            this.IDString = d.ToString("id_str");
            this.Indices = new Indices(d.ToString("indices"));
            this.Name = d.ToString("name");
            this.ScreenName = d.ToString("screen_name");
        }
    }
}
